#include "stdafx.h"
#include "vector2.h"
#include "vector3.h"
#include "../inc/Grid2DPageStrategy.h"

using namespace PageSystem;

////-----Grid2DPageStrategy-------///
Grid2DPageStrategy::Grid2DPageStrategy(PageManager* manager)
	:PageStrategy( "G2D" , mManager )
{
	assert(manager != NULL );
}

PageStrategyData* Grid2DPageStrategy::createData()
{
	return new Grid2DPageStrategyData;
}

void Grid2DPageStrategy::notifyPageCamera(PageCamera* cam, PagedWorldSection* section)
{
	if( cam == NULL ||  section == NULL )
		return;
}

void Grid2DPageStrategy::destroyData(PageStrategyData* d)
{

}

PageID Grid2DPageStrategy::getPageID(const Common::Vector3& worldPos, PagedWorldSection* section)
{
}

////-----Grid2DPageStrategyData-------///
Grid2DPageStrategyData::Grid2DPageStrategyData()
	:PageStrategyData(),
	/// Orientation of the grid
	mMode( Grid2DMode::G2D_X_Y ),
	/// Origin (world space)
	mWorldOrigin( ) ,
	/// Origin (grid-aligned world space)
	mOrigin,
	/// Grid cell (page) size
	mCellSize(500),
	/// Load radius
	mLoadRadius(100.0f),
	/// Hold radius
	mHoldRadius(200.0f),
	mLoadRadiusInCells,
	mHoldRadiusInCells,
	mMinCellX,mMinCellY,
	mMaxCellX,mMaxCellY
{
}
Grid2DPageStrategyData::~Grid2DPageStrategyData()
{
}

/// Convert a world point to grid space (not relative to origin)
void Grid2DPageStrategyData::convertWorldToGridSpace(const Common::Vector3& world, Common::Vector2& grid)
{
}
/// Convert a grid point to world space - note only 2 axes populated
void Grid2DPageStrategyData::convertGridToWorldSpace(const Common::Vector2& grid, Common::Vector3& world)
{
}
/// Get the (grid space) mid point of a cell
void Grid2DPageStrategyData::getMidPointGridSpace(int32 x, int32 y, Common::Vector2& mid)
{
}
/// Get the (grid space) bottom-left of a cell
void Grid2DPageStrategyData::getBottomLeftGridSpace(int32 x, int32 y, Common::Vector2& bl)
{
}
/** Get the (grid space) corners of a cell.
@remarks
Populates pFourPoints in anticlockwise order from the bottom left point.
*/
void Grid2DPageStrategyData::getCornersGridSpace(int32 x, int32 y, Common::Vector2* pFourPoints)
{
}

/// Convert a grid position into a row and column index
void Grid2DPageStrategyData::determineGridLocation(const Common::Vector2& gridpos, int32* x, int32* y)
{
}

PageID Grid2DPageStrategyData::calculatePageID(int32 x, int32 y)
{
}

void Grid2DPageStrategyData::calculateCell(PageID inPageID, int32* x, int32* y)
{
}
